package com.gss.entity.enums;

import javax.servlet.http.HttpServletResponse;

/**
 * @author DYang
 * @date 2023-05-09
 */
public enum ConstantEnum {
    SUCCESS(HttpServletResponse.SC_OK, "操作成功"),
    FAIL(HttpServletResponse.SC_BAD_REQUEST, "操作失败"),
    NON_AUTH(HttpServletResponse.SC_UNAUTHORIZED, "权限不足，请联系管理员"),

    TOKEN_ERROR(HttpServletResponse.SC_FORBIDDEN, "无效TOKEN, 请重新登录！"),

    TOKEN_MISS(HttpServletResponse.SC_FORBIDDEN, "token 丢失"),
    TOKEN_EXPIRE(HttpServletResponse.SC_FORBIDDEN, "token过期，请重新登录"),
    TOKEN_JWT_ERROR(HttpServletResponse.SC_UNAUTHORIZED, "TOKEN异常，该类型JWT错误"),
    TOKEN_SIGN_ERROR(HttpServletResponse.SC_UNAUTHORIZED, "TOKEN异常，令牌错误"),

    USER_CODE_ERROR(HttpServletResponse.SC_UNAUTHORIZED, "用户名或密码错误"),

    NOT_FOUND(HttpServletResponse.SC_NOT_FOUND, "路径不存在，请检查路径是否正确"),

    REQUEST_TIMEOUT(HttpServletResponse.SC_REQUEST_TIMEOUT, "系统调用异常"),

    USER_OLD_PASSWORD(10005,"原密码不正确"),

    USER_FREEZE(10007,"用户已冻结"),

    REDIS_CONNECT_ERROR(10008,"redis 连接异常"),

    PARAM_ERROR(10009, "参数为空"),

    VALIDATION_CODE_ERROR(10010, "验证码失效，请重新获取"),

    USER_EXIST(10011, "该用户已存在"),

    INSERT_ERROR(10012, "新增失败,请重试"),

    NO_FILE(10013, "未包含文件上传域"),

    TYPE(10014, "不允许的文件格式"),

    SIZE(10015, "文件大小超出限制，最大支持2Mb"),

    EN_TYPE(10016, "请求类型ENTYPE错误"),

    REQUEST(10017, "上传请求异常"),

    IO(10018, "IO异常"),

    DIR(10019, "目录创建失败"),

    UNKNOWN(10020, "未知错误"),


    NO_ALIYUN_CONFIG(10022, "请先在后台设置阿里云配置信息"),

    NO_PERMISSION(10023, "没有权限信息"),

    SIGNATURE_EX(10024, "签名错误"),

    ILLEGAL_ARG(10025, "非法错误"),

    EXPIRED_JWT(10026, "token过期,请重新登录"),

    DUPLICATE_KEY(10027, "数据库中已存在该记录"),

    RESOURCE_ACCESS(10028, "系统之间调用异常"),

    ACCESS_DENIED(HttpServletResponse.SC_FORBIDDEN, "Token非法参数异常"),

    IMAGE_ERROR(10029, "验证码为空或者验证码输入有误"),

    LOGINED(10030, "账号已被登录"),

    EXPIRED_LOGIN(HttpServletResponse.SC_BAD_REQUEST, "登录超时,请重新登录"),

    DATA_DUPLICATION(10031, "数据重复"),
    UPDATE_ERROR(10032, "编辑失败,请重试"),
    DEL_ERROR(10033, "删除失败,请重试"),
    USING_ERROR(10034, "正在使用中，请勿删除"),

    CAPTCHA_EXPIRE(1001,"验证码过期"),
    CAPTCHA_ERROR(1002,"验证码错误"),
    NO_USER(10035, "用户不存在"),
    NO_DEPT(10036, "未授权部门"),
    NO_ROLE(10037, "未授权角色"),
    NO_RESOURCE(10038, "未授权资源"),

            ;

    private  Integer code;
    private  String msg;

    ConstantEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
